#@adminLayout()
#define main()
<main class="app-content">
<div class="app-title">
	<div>
		<h1><i class="fa fa-edit"></i>用户资料修改</h1>
		<p>修改用户的资料</p>
	</div>
      <ul class="app-breadcrumb breadcrumb">
        <li class="breadcrumb-item"><a href="/admin"><i class="fa fa-home fa-lg"></i>仪表盘</a></li>
        <li class="breadcrumb-item active"><a href="/admin/user">用户管理</a></li>
        <li class="breadcrumb-item active"><a href="javascript:;">资料修改</a></li>
      </ul>
</div>
<form action="/admin/user/userUpdate" method="post" id="myArticleForm">
<div class="row">
	<div class="col-md-12">
		<div class="tile">
			<div class="row">
				<div class="col-lg-6">
					<input type="hidden" name="user.uid" value="#(user.uid)">
					<div class="form-group">
						<label >用户头像</label>
						<img alt="#(user.nickName)" src="/upload/avatar/#(user.avatar)">
						<small class="form-text text-muted"><a href="">修改头像</a></small>
					</div>
					<div class="form-group">
						<label >用户昵称</label>
						<input class="form-control" type="text" name="user.nickName" value="#(user.nickName)">
					</div>
					<div class="form-group">
						<label >个人签名</label>
						<input class="form-control" type="text" name="user.sign" value="#(user.sign)">
					</div>
					<div class="form-group">
						<label >用户主页浏览量</label>
						<input class="form-control" type="text" name="user.views" value="#(user.views)">
					</div>
					<div class="form-group">
						<label >认证说明</label>
						<input class="form-control" type="text" name="user.authName" value="#(user.authName)" disabled>
					</div>
				</div>
				<div class="col-lg-4 offset-lg-1">
					<div class="form-group">
						<label >用户邮箱</label>
						<input class="form-control" type="text" name="user.email" value="#(user.email)" disabled>
					</div>
					<div class="form-group">
						<label >用户威望</label>
						<input class="form-control" type="text" name="user.prestige" value="#(user.prestige)" >
					</div>
					<div class="form-group">
						<label >用户积分</label>
						<input class="form-control" type="text" name="user.points" value="#(user.points)">
					</div>
					<div class="form-group">
						<label class="control-label">是否认证</label>
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="radio" name="user.is_auth" value="0" #if(user.is_auth==0) checked #end>没有认证
							</label>
						</div>
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="radio" name="user.is_auth" value="1" #if(user.is_auth==1) checked #end>已经认证
							</label>
						</div>
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="radio" name="user.is_auth" value="2" #if(user.is_auth==2) checked #end>待审核
							</label>
						</div>
					</div>

					<div class="form-group">
						<label class="control-label">是否VIP</label>
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="radio" name="user.is_vip" value="1" #if(user.is_vip==1) checked #end>是VIP
							</label>
						</div>
						<div class="form-check">
							<label class="form-check-label">
								<input class="form-check-input" type="radio" name="user.is_vip" value="0" #if(user.is_vip==0) checked #end>不是VIP
							</label>
						</div>
					</div>

					<div class="form-group">
						<label >真实姓名</label>
						<input class="form-control" type="text" name="user.trueName" value="#(user.trueName)" disabled>
					</div>
					<div class="form-group">
						<label >认证时间</label>
						<input class="form-control" type="text" name="user.authTime" value="#(user.authTime)" disabled>
					</div>
				</div>
			</div>
			<div class="tile-footer">
				<input class="btn btn-primary" type="submit" value="提交" />
			</div>
		</div>
	</div>
</div>
</form>
</main>
#end
#define js()
<script type="text/javascript" src="/static/lib/jquery_form/jquery.form.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#myArticleForm").ajaxForm({
			dataType: "json"
			, beforeSubmit: function(formData, jqForm, options) {}
			, success: function(ret) {
				if (ret.state == "ok") {
					location.href = "/admin/user?p=#(p ?? 1)";
				} else {
					showFailMsg(ret.msg);
				}
			}
			, error: function(ret) {alert(ret.statusText);}
			, complete: function(ret) {} 	      // 无论是 success 还是 error，最终都会被回调
		});
	});
</script>
#end